#include "interruptmanager.h"

InterruptManager::InterruptManager(QObject *parent) : QObject(parent)
{
}

void InterruptManager::registerInterruptHandler(int interruptNumber, InterruptHandler* handler)
{
    interruptHandlers[interruptNumber] = handler;
}

void InterruptManager::triggerInterrupt(int interruptNumber)
{
    if(interruptHandlers.contains(interruptNumber)) {
        interruptHandlers[interruptNumber]->handleInterrupt(interruptNumber);
    } else {
        // 处理未注册的中断
    }
}

void InterruptManager::clearHandlers()
{
    interruptHandlers.clear();
}    